/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package network.packets;

import utils.Utils;

/**
 *
 * @author Kvest
 */
public class FilteredTaxiParkingsResponce extends Packet
{
    public static final int RESULT_OK = 0;
    public static final int RESULT_ERROR = 1;
 
    private int returnID;
    private String errorMessage;
    
    public FilteredTaxiParkingsResponce(byte[] data)
    {
        super(FILTERED_TAXI_PARKINGS_RESPONCE);

        parse(data);
    }
    
    protected void parse(byte[] data)
    {
        int offset = 0;

        //Пропускаем название пакета
        byte[] buffer4 = new byte[4];
        System.arraycopy(data, offset, buffer4, 0, buffer4.length);
        offset += buffer4.length + Utils.byteToInt(buffer4);
       
        //ReturnID
        System.arraycopy(data, offset, buffer4, 0, buffer4.length);
        offset += buffer4.length;
        returnID = Utils.byteToInt(buffer4);
        
        //errorMessage
        //Пока не парсим
        
        buffer4 = null;
        //buffer = null;        
    }

    public String getErrorMessage() 
    {
        return errorMessage;
    }

    public void setErrorMessage(String errorMessage) 
    {
        this.errorMessage = errorMessage;
    }

    public int getReturnID() 
    {
        return returnID;
    }

    public void setReturnID(int returnID) 
    {
        this.returnID = returnID;
    }
}
